
# todo: ==================== 业务数据首日（第一次）同步 ====================

# ======================================================================
#                       省份表：base_province（特殊，同步一次）
# ======================================================================
/opt/module/sqoop/bin/sqoop import \
--connect jdbc:mysql://node101:3306/gmall \
--username root \
--password 123456 \
--target-dir /origin_data/gmall/db/base_province/2023-09-01 \
--delete-target-dir \
--query "SELECT
  id,
  name,
  region_id,
  area_code,
  iso_code,
  iso_3166_2
FROM base_province
WHERE \$CONDITIONS" \
--num-mappers 1 \
--fields-terminated-by '\t' \
--compress \
--compression-codec gzip \
--null-string '\\N' \
--null-non-string '\\N'


# ======================================================================
#                       区域表：base_region（特殊，同步一次）
# ======================================================================
/opt/module/sqoop/bin/sqoop import \
--connect jdbc:mysql://node101:3306/gmall \
--username root \
--password 123456 \
--target-dir /origin_data/gmall/db/base_region/2023-09-01 \
--delete-target-dir \
--query "SELECT
  id,
  region_name
FROM base_region
WHERE \$CONDITIONS" \
--num-mappers 1 \
--fields-terminated-by '\t' \
--compress \
--compression-codec gzip \
--null-string '\\N' \
--null-non-string '\\N'


